package com.atguigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Date:2020/9/28
 * Author:ybc
 * Description:
 */
@Controller
@RequestMapping("/request")
public class RequestController {

    @RequestMapping(value = {"/testRequest", "/test"},
                    method = {RequestMethod.GET, RequestMethod.POST},
                    params = {"!username","password=123"},
                    headers = {"Accept-Language=zh-CN,zh;q=0.9"})
    public String testRequest(){
        System.out.println("请求成功");
        return "success";
    }

    //@RequestMapping("/testURL")
    //@RequestMapping("/ant??/testURL")
    //@RequestMapping("/ant??/**/testURL")
    @RequestMapping("/testURL/{username}/{id}")
    public String testURL(@PathVariable("username") String username, @PathVariable("id") Integer id){
        System.out.println(username+","+id);
        return "success";
    }

}
